package acs.offer.pojo;


import java.util.UUID;

public class Message {
    private Header header;
    private String content;
    
    public static Message build(String content,String sessionId){
    	return  build(1,sessionId,content);
    }

    public static Message build(String content){
        return build(1,UUID.randomUUID().toString(),content);
    }
    public static Message build(int version, String sessionId, String content){
        Header header = new Header(version, content.length(), sessionId);
        return  new Message(header,content);
    }

    public Message(Header offerHeader, String content) {
        this.header = offerHeader;
        this.content = content;
    }

    public Header getHeader() {
        return header;
    }

    public void setHeader(Header header) {
        this.header = header;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "OfferMessage{" +
                "header=" + header +
                ", content='" + content + '\'' +
                '}';
    }
}
